#include <cstdio>
#include <algorithm>
int main(void){
    long long n,m;
    while(~scanf("%lld%lld",&n,&m)){
        if(n==0 && m==0){
            break;
        }
        printf("%lld\n",n+m-2);
    }
    return 0;
}
